/*
 * @author       :成家杰
 * @date         :2022-06-21 19:31:50
 * @Description  : com.tj.service.impl
 * @version      : 1.0
 */
package com.tj.service.impl;

import com.tj.mapper.HospitalMapper;
import com.tj.pojo.Hospital;
import com.tj.service.HospitalService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class HospitalServiceImpl implements HospitalService {
    
    @Resource
    private HospitalMapper hospitalMapper;
    /**
     * @return
     */
    @Override
    public List<Hospital> selectAll() {
        return hospitalMapper.selectAll();
    }
    
    /**
     * @param id
     * @return
     */
    @Override
    public Hospital selectById(int id) {
        return null;
    }
    
    /**
     * @return
     * @throws Exception
     */
    @Override
    public List<Hospital> selectByHospitalId(Integer id) throws Exception {
        return hospitalMapper.selectByHospitalId(id);
    }
    
    /**
     * @param name
     * @param picture
     * @param telephone
     * @param address
     * @param businessHours
     * @param deadline
     * @param rule
     * @param state
     * @return
     * @throws Exception
     */
    @Override
    public int insert(String name, String picture, String telephone, String address, String businessHours, String deadline, String rule, int state) throws Exception {
        return hospitalMapper.insert(name, picture, telephone, address, businessHours, deadline, rule, state);
    }
    
    /**
     * @param id
     * @return
     * @throws Exception
     */
    @Override
    public int delete(Integer id) throws Exception {
        return hospitalMapper.delete(id);
    }
    
    /**
     * @param id
     * @param name
     * @param picture
     * @param telephone
     * @param address
     * @param businessHours
     * @param deadline
     * @param rule
     * @param state
     * @return
     * @throws Exception
     */
    @Override
    public int update(Integer id, String name, String picture, String telephone, String address, String businessHours, String deadline, String rule, int state) throws Exception {
        return hospitalMapper.update(id,name, picture, telephone, address, businessHours, deadline, rule, state);
    }
    
    /**
     * @param name
     * @return
     * @throws Exception
     */
    @Override
    public List<Hospital> Fuzzyquery(String name) throws Exception {
        return hospitalMapper.getFuzzyquery(name);
    }
}
